package com.shadow.bus.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangyu
 * @date 2018/7/4
 */

public class TroubleOperationEntity implements Serializable {
    long Id;
    //顶级类型 发动机系...
    long ClassificationId;
    String ClassificationName;
    long TroubleTypeId;
    long TroubleId;
    String TroubleTypeName;
    OperationEntity Operation;
    PartEntity Component;
    PartEntity Accessory;
    long UseCount;
    PersonEntity WorkPerson;
    private List<PersonEntity> ListWorkPerson;
    String WorkTime;
    boolean isChecked;
    boolean IsRework;
    private String Name;
    private ArrayList<TroubleEntity> children;

    public ArrayList<TroubleEntity> getChildren() {
        return children;
    }

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public List<PersonEntity> getListWorkPerson() {
        return ListWorkPerson;
    }

    public void setListWorkPerson(List<PersonEntity> listWorkPerson) {
        ListWorkPerson = listWorkPerson;
    }

    public void setChildren(ArrayList<TroubleEntity> children) {
        this.children = children;
    }

    public long getId() {
        return Id;
    }

    public void setId(long id) {
        Id = id;
    }

    public long getClassificationId() {
        return ClassificationId;
    }

    public void setClassificationId(long classificationId) {
        this.ClassificationId = classificationId;
    }

    public String getClassificationName() {
        return ClassificationName;
    }

    public void setClassificationName(String classificationName) {
        this.ClassificationName = classificationName;
    }

    public long getTroubleTypeId() {
        return TroubleTypeId;
    }

    public void setTroubleTypeId(long troubleTypeId) {
        this.TroubleTypeId = troubleTypeId;
    }

    public long getTroubleId() {
        return TroubleId;
    }

    public void setTroubleId(long troubleId) {
        this.TroubleId = troubleId;
    }

    public String getTroubleTypeName() {
        return TroubleTypeName;
    }

    public void setTroubleTypeName(String troubleTypeName) {
        this.TroubleTypeName = troubleTypeName;
    }

    public OperationEntity getOperation() {
        return Operation;
    }

    public void setOperation(OperationEntity operation) {
        Operation = operation;
    }

    public PartEntity getComponent() {
        return Component;
    }

    public void setComponent(PartEntity component) {
        Component = component;
    }

    public PartEntity getAccessory() {
        return Accessory;
    }

    public void setAccessory(PartEntity accessory) {
        Accessory = accessory;
    }

    public long getUseCount() {
        return UseCount;
    }

    public void setUseCount(long useCount) {
        UseCount = useCount;
    }

    public PersonEntity getWorkPerson() {
        return WorkPerson;
    }

    public void setWorkPerson(PersonEntity workPerson) {
        WorkPerson = workPerson;
    }

    public String getWorkTime() {
        return WorkTime;
    }

    public void setWorkTime(String workTime) {
        WorkTime = workTime;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public boolean isRework() {
        return IsRework;
    }

    public void setIsRework(boolean rework) {
        IsRework = rework;
    }

    public TroubleOperationEntity copy() {
        TroubleOperationEntity entity = new TroubleOperationEntity();
        entity.setId(Id);
        entity.setClassificationId(ClassificationId);
        entity.setClassificationName(ClassificationName);
        entity.setTroubleTypeId(TroubleTypeId);
        entity.setTroubleId(TroubleId);
        entity.setTroubleTypeName(TroubleTypeName);
        OperationEntity operationEntity = new OperationEntity();
        operationEntity.setId(Operation.getId());
        operationEntity.setCode(Operation.getCode());
        operationEntity.setName(Operation.getName());
        entity.setOperation(operationEntity);
        PartEntity PartEntityCom = new PartEntity();
        if (Component != null) {
            PartEntityCom.setId(Component.getId());
            PartEntityCom.setCode(Component.getCode());
            PartEntityCom.setName(Component.getName());
            entity.setComponent(Component);
        }
        PartEntity PartEntityAcc = new PartEntity();
        if (Accessory != null) {
            PartEntityAcc.setId(Accessory.getId());
            PartEntityAcc.setCode(Accessory.getCode());
            PartEntityAcc.setName(Accessory.getName());
            entity.setAccessory(PartEntityAcc);
        }
        entity.setUseCount(UseCount);
        PersonEntity personEntity = new PersonEntity();
        personEntity.setId(WorkPerson.getId());
        personEntity.setCode(WorkPerson.getCode());
        personEntity.setName(WorkPerson.getName());
        entity.setWorkPerson(personEntity);
        entity.setWorkTime(WorkTime);
        entity.setIsRework(false);
        return entity;
    }
}
